import Https from '@/utils/https'

// 页面上方的统计
const querySummaryReq = (params) => Https.get('/api/v1/integration/offline/operation/summary', params)

// 查询子任务
const queryChildrenReq = (params) => Https.get('/api/v1/offlineDev/operation/v2/taskManager/children', params)

// 查询日志
const queryLogReq = (params) => Https.get('/api/v1/integration/offline/operation/log', params, { needCode: true })

// 获取监控流程
const queryGetAllTaskFlowReq = (params) => Https.get('/api/v1/offlineDev/operation/getAllTaskFlow', params)

// 获取所以通知用户信息
const queryGetCallUserInfoReq = (params) => Https.get('/api/v1/offlineDev/operation/getCallUserInfo', params)

// 保存监控
const querySaveReq = (params) => Https.post('/api/v1/offlineDev/operation/taskAlarm/save', params, { needCode: true })

// 获取节点类型
const queryGetParentTypeReq = (params) => Https.get('/api/v1/offlineDev/operation/getParentType', params, { needCode: true })

// 今日任务完成情况
const queryTodayReq = (params) => Https.get('/api/v1/integration/offline/operation/finished/today', params)

//
const queryTaskMonitorListReq = (params) => Https.get('/api/v1/integration/offline/operation/taskMonitor/list', params)

// 查询用户信息列表
const queryUserListReq = (params) => Https.get('/api/v1/integration/offline/operation/userList', params)

// 上线 or 下线
const queryChangeReq = (params) => Https.get('/api/v1/offlineDev/operation/v2/taskflows/change', params, { needCode: true })

// 重跑任务
const queryRestartReq = (params) => Https.get('/api/v1/integration/offline/operation/run', params, { needCode: true })

// 停止任务-批量停止任务
const queryStopReq = (params) => Https.post('/api/v1/integration/offline/operation/stop', params, { needCode: true, json: false })

// 任务运行记录 子任务
const queryJobChildrenReq = (params) => Https.get('/api/v1/offlineDev/operation/v2/job/children', params)

// 忽略任务
const ignore = (params) => Https.get('/api/v1/integration/offline/operation/ignore', params, { needCode: true })

export {
  querySummaryReq, queryChildrenReq, queryLogReq, queryGetAllTaskFlowReq, queryGetCallUserInfoReq,
  querySaveReq, queryGetParentTypeReq, queryTodayReq, queryTaskMonitorListReq, queryUserListReq,
  queryChangeReq, queryRestartReq, queryStopReq, queryJobChildrenReq, ignore,
}
